import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("idx_name", ["name"], {})
@Index("idx_type", ["type"], {})
@Entity("rrz_config", { schema: "rrzcms" })
export class RrzConfig {
  @PrimaryGeneratedColumn({ type: "int", name: "id" })
  id: number;

  @Column("varchar", {
    name: "name",
    nullable: true,
    comment: "配置的key键名",
    length: 50,
  })
  name: string | null;

  @Column("text", { name: "value", nullable: true, comment: "配置内容" })
  value: string | null;

  @Column("varchar", {
    name: "type",
    nullable: true,
    comment: "类型",
    length: 64,
  })
  type: string | null;

  @Column("varchar", {
    name: "desc",
    nullable: true,
    comment: "描述",
    length: 50,
  })
  desc: string | null;

  @Column("varchar", {
    name: "lang",
    nullable: true,
    comment: "语言标识",
    length: 50,
    default: () => "'cn'",
  })
  lang: string | null;

  @Column("tinyint", {
    name: "is_del",
    comment: "是否已删除（0：否，1：是）",
    unsigned: true,
    default: () => "'0'",
  })
  isDel: number;
}
